﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="reportProductCategory.aspx.cs"
    Inherits="PeisongWeb.admin.reportProductCategory" %>

<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register TagName="top" Src="controls/top.ascx" TagPrefix="uc1" %>
<%@ Register TagName="menu" Src="controls/menu.ascx" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>商品分类统计 - 想购网长期采购物流配送系统</title>
    <!--#include file="style.inc"-->

    <script type="text/javascript">
        function resetSrh() {
            document.getElementById("ext_StartInputDt").value = "";
            document.getElementById("ext_EndInputDt").value = "";
            document.getElementById("drp_CategoryRoot").value = "";
            document.getElementById("drp_CategorySub").value = "";
            document.getElementById("drp_Company").value = "0";
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="sm1" runat="server">
    </asp:ScriptManager>
    <ext:ScriptManager ID="ScriptManager1" runat="server" />
    <uc1:top ID="Top1" runat="server" />
    <uc2:menu ID="Menu1" runat="server" />
    <div id="admin-body">
        <h2 class="section-cms">
            商品分类统计
        </h2>
        <asp:UpdatePanel runat="server" ID="UpdatePanel2" UpdateMode="Conditional">
            <ContentTemplate>
                <ext:Panel ID="Panel1" runat="server" Title="搜索" BodyStyle="padding:5px 5px 0" Width="1200px"
                    Frame="true" ButtonAlign="Center">
                    <Body>
                        <ext:Panel ID="Panel5" runat="server">
                            <Body>
                                <ext:ColumnLayout ID="ColumnLayout2" runat="server">
                                    <ext:LayoutColumn ColumnWidth=".5">
                                        <ext:Panel ID="Panel6" runat="server" Border="false" Header="false">
                                            <Body>
                                                <div id="admin_edit_content_search">
                                                    <ul>
                                                        <li style="width: auto;">
                                                            <label style="width: auto">
                                                                大类
                                                            </label>
                                                            <asp:DropDownList runat="server" ID="drp_CategoryRoot" DataTextField="name" DataValueField="categoryId"
                                                                AutoPostBack="True" OnSelectedIndexChanged="ddl_CategoryRoot_SelectedIndexChanged">
                                                            </asp:DropDownList>
                                                        </li>
                                                        <li style="width: auto; margin-right: 30px">
                                                            <label>
                                                                小类
                                                            </label>
                                                            <asp:DropDownList runat="server" ID="drp_CategorySub" DataTextField="name" DataValueField="categoryId">
                                                            </asp:DropDownList>
                                                        </li>
                                                        <li style="width: auto">
                                                            <label>
                                                                订单日期</label>
                                                            <ext:DateField ID="ext_StartInputDt" runat="server" AllowBlank="true" ReadOnly="true"
                                                                Width="100" />
                                                        </li>
                                                        <li style="width: auto; margin-right: 30px">
                                                            <label style="width: 25px">
                                                                至
                                                            </label>
                                                            <ext:DateField ID="ext_EndInputDt" ReadOnly="true" runat="server" Width="100" />
                                                        </li>
                                                        <li style="width: auto; margin-right: 30px">
                                                            <label>
                                                                企业
                                                            </label>
                                                            <asp:DropDownList runat="server" ID="drp_Company" DataTextField="company" DataValueField="companyId">
                                                            </asp:DropDownList>
                                                        </li>
                                                        <li style="width: auto">
                                                            <label>
                                                                &nbsp;
                                                            </label>
                                                            [<asp:LinkButton ID="lbtn_Search" runat="server" Text="搜 索" OnClick="lbtn_Search_Click">
                                                            </asp:LinkButton>]&nbsp;&nbsp;&nbsp; [<a href="javascript:resetSrh();">重 置</a>]
                                                            <input type="hidden" runat="server" id="hid_categoryId" />
                                                        </li>
                                                    </ul>
                                                </div>
                                            </Body>
                                        </ext:Panel>
                                    </ext:LayoutColumn>
                                </ext:ColumnLayout>
                            </Body>
                        </ext:Panel>
                    </Body>
                </ext:Panel>
                <p>
                    &nbsp;</p>
                <div id="admin_list_content" style="width: 1200px">
                    <table cellpadding="0" cellspacing="0">
                        <tr class="header-row">
                            <th>
                                商品大类
                            </th>
                            <th>
                                商品小类
                            </th>
                            <th>
                                <label runat="server" id="lbl_Price">
                                </label>
                            </th>
                            <th>
                                平均数量
                            </th>
                            <th>
                                总数量
                            </th>
                            <th>
                                商品小计
                            </th>
                            <th>
                                详细信息
                            </th>
                        </tr>
                        <asp:Repeater ID="rpt_list" runat="server" OnItemCommand="rpt_list_ItemCommand">
                            <ItemTemplate>
                                <tr class='<%# Container.ItemIndex%2==0? "row-alt":"alt"  %>'>
                                    <td>
                                        <%#Eval("parentName")%>
                                    </td>
                                    <td>
                                        <%# Eval("subCategory")%>
                                    </td>
                                    <td>
                                        <%#Convert.ToInt32(Eval("type")) == 2 ? String.Format("{0:F2}", Eval("avgPrice")).ToString() : String.Format("{0:F2}", Eval("avgSellerPrice")).ToString()%>
                                    </td>
                                    <td>
                                        <%#String.Format("{0:F2}", Eval("avgQuantity"))%>
                                    </td>
                                    <td>
                                        <%#Eval("sumQuantity")%>
                                    </td>
                                    <td>
                                        <%# String.Format("{0:F2}", Eval("sumAmount")).ToString()%>
                                    </td>
                                    <td>
                                        <asp:LinkButton ID="lbn_details" runat="server" CommandName="details" CommandArgument='<%# Eval("categoryid") %>'
                                            Text="查看详情">
                                        </asp:LinkButton>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                    </table>
                </div>
                <ext:Window ID="category_details" runat="server" Title="商品分类详情" Height="620px" Width="920px"
                    BodyStyle="padding: 6px; background-color: #fff;" AutoScroll="true" Modal="True"
                    Resizable="false" ShowOnLoad="false" Draggable="false" Icon="ApplicationViewDetail">
                    <Body>
                        <asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional">
                            <ContentTemplate>
                                <div class="details">
                                    <table width="98%" border="0" cellpadding="4" cellspacing="1" style="text-align: left">
                                        <tr>
                                            <td style="width: 6%">
                                                订单号：
                                            </td>
                                            <td style="width: 20%">
                                                <asp:TextBox ID="txt_orderNo" runat="server" Width="80px"></asp:TextBox>
                                            </td>
                                            <td style="width: 8%">
                                                订单日期：
                                            </td>
                                            <td style="width: 12%">
                                                <ext:DateField ID="txt_startOrderDt" runat="server" AllowBlank="true" ReadOnly="true"
                                                    Width="100" />
                                            </td>
                                            <td style="width: 3%">
                                                至
                                            </td>
                                            <td style="width: 20%">
                                                <ext:DateField ID="txt_endOrderDt" ReadOnly="true" runat="server" Width="100" />
                                            </td>
                                            <td style="width: 7%">
                                                <asp:LinkButton ID="lbn_search" runat="server" Text="［搜索］" CausesValidation="false"
                                                    OnClick="lbn_search_Click">
                                                </asp:LinkButton>
                                            </td>
                                            <td style="width: 22%">
                                            </td>
                                        </tr>
                                    </table>
                                    <p>
                                        &nbsp;</p>
                                    <table width="98%" border="0" cellpadding="4" cellspacing="1" bgcolor="#99BBE8" style="text-align: left">
                                        <tr align="center" style="height: 20px;">
                                            <td width="8%" bgcolor="#C0D5F0">
                                                商品编号
                                            </td>
                                            <td width="10%" bgcolor="#C0D5F0">
                                                商品名称
                                            </td>
                                            <td width="8%" bgcolor="#C0D5F0">
                                                规格
                                            </td>
                                            <td width="10%" bgcolor="#C0D5F0">
                                                供应商价格
                                            </td>
                                            <td width="10%" bgcolor="#C0D5F0">
                                                数量
                                            </td>
                                            <td width="10%" bgcolor="#C0D5F0">
                                                单价
                                            </td>
                                            <td width="10%" bgcolor="#C0D5F0">
                                                小计
                                            </td>
                                            <td width="10%" bgcolor="#C0D5F0">
                                                订单号
                                            </td>
                                        </tr>
                                        <asp:Repeater runat="server" ID="rpt_Products">
                                            <ItemTemplate>
                                                <tr align="center" style="height: 20px;">
                                                 <td bgcolor="#FFFFFF">
                                                        <%#Eval("productNo")%>
                                                    </td>
                                                    <td bgcolor="#FFFFFF">
                                                        <%#Eval("proName")%>
                                                    </td>
                                                    <td bgcolor="#FFFFFF">
                                                        <%#Eval("standard")%>
                                                    </td>
                                                   
                                                    <td bgcolor="#FFFFFF">
                                                        <%#String.Format("{0:F2}",Eval("sellerPrice"))%>/<%#Eval("unit")%>
                                                    </td>
                                                    <td bgcolor="#FFFFFF">
                                                        <%#Eval("quantity")%>
                                                    </td>
                                                    <td bgcolor="#FFFFFF" align="center">
                                                        <%#String.Format("{0:F2}",Eval("price"))%>/<%#Eval("unit")%>
                                                    </td>
                                                    <td bgcolor="#FFFFFF" align="center">
                                                        <%#String.Format("{0:F2}",Eval("amount"))%>
                                                    </td>
                                                    <td bgcolor="#FFFFFF" align="center">
                                                        <%#Eval("orderNo")%>
                                                    </td>
                                                </tr>
                                            </ItemTemplate>
                                        </asp:Repeater>
                                    </table>
                                    <div>
                                        <webdiyer:AspNetPager ID="AspNetPager2" NumericButtonType="Text" MoreButtonType="Text"
                                            runat="server" AlwaysShow="False" PageSize="20" InvalidPageIndexErrorMessage="无效页码"
                                            PageIndexOutOfRangeErrorMessage="页码超出范围" ShowCustomInfoSection="Left" CustomInfoHTML=" 每页%PageSize%条记录 | 总共%RecordCount%条记录 "
                                            CustomInfoTextAlign="Left" HorizontalAlign="Right" OnPageChanged="AspNetPager2_PageChanged"
                                            NextPageText="下一页" FirstPageText="首页" LastPageText="末页" PrevPageText="上一页">
                                        </webdiyer:AspNetPager>
                                    </div>
                                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </Body>
                </ext:Window>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
